package demo4;

/**
 * Author：毕龙
 * Date: 2024/5/17 11:45
 */
public class TestQuestion4 {
    public static void main(String[] args) {
        String str = "1239586838923173478943890234092";
        StringBuilder sb = new StringBuilder();
        StringBuilder sb1 = new StringBuilder();
        int count =0;
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if(!sb.toString().contains(c+"")){
                sb.append(c);
                count ++;
                for (int j = i+1; j < str.length(); j++) {
                    char c1 = str.charAt(j);
                    if(c == c1){
                        count++;
                    }
                }
                sb1.append(c+"--->"+count+"\n");
                count=0;
            }
        }
        System.out.println(sb1);
    }
}
